using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Deepcode.Flux.Core.Data;

namespace Example.Workflow.Objects
{
	/// <summary>
	/// Represents an entry in the telephone book
	/// </summary>
	public class TelephoneBookEntry
	{
		private int _PK_ID = -1;
		private string _Name = "";
		private string _Tel = "";
		private int _State = -1;
		private string _Notes = "";
		private string _ApprovalHistory = "";
		private int _FK_WorkflowDefinition = -1;

		public int PK_ID { get { return _PK_ID; } set { _PK_ID = value; } }
		public string Name { get { return _Name; } set { _Name = value; } }
		public string Tel { get { return _Tel; } set { _Tel = value; } }
		public int State { get { return _State; } set { _State = value; } }
		public string Notes { get { return _Notes; } set { _Notes = value; } }
		public string ApprovalHistory { get { return _ApprovalHistory; } set { _ApprovalHistory = value; } }
		public int FK_WorkflowDefinition { get { return _FK_WorkflowDefinition; } set { _FK_WorkflowDefinition = value; } }

		// Constructor to create new without loading
		public TelephoneBookEntry() { }

		// Constructor loading from a data row
		public TelephoneBookEntry (DataRow r)
		{
			_PK_ID = SQLUtility.DBNull(r["PK_ID"], -1);
			_Name = SQLUtility.DBNull(r["Name"], "");
			_Tel = SQLUtility.DBNull(r["Tel"], "");
			_State = SQLUtility.DBNull(r["State"], -1);
			_Notes = SQLUtility.DBNull(r["Notes"], "");
			_ApprovalHistory = SQLUtility.DBNull(r["ApprovalHistory"], "");
			_FK_WorkflowDefinition = SQLUtility.DBNull(r["FK_WorkflowDefinition"], -1);
		}
	}
}
